<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>财务端  退款记录</title>
    <link rel="icon" href="favicon.ico" type="images/ico">
    <meta name="author" content="dc">
    <link rel="stylesheet" type="text/css" href="/css/materialdesignicons.min.css">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/css/style.min.css">
    <link rel="stylesheet" href="/js/bootstrap-table/bootstrap-table-1.18.3.min.css">
    <link rel="stylesheet" href="/js/jquery-confirm/jquery-confirm.min.css"/>
    <link rel="stylesheet" href="/css/skin.css"/>
    <!--固定table列-->
    <link href="/js/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.min.css" rel="stylesheet"/>
    <!--时间选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css"/>
    <link rel="stylesheet" type="text/css" href="/css/daterangepicker.css" />
    <!--日期选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datepicker/bootstrap-datepicker3.min.css"/>
    <!-- 多选下拉 -->
    <link rel="stylesheet" href="/css/bootstrap-multiselect.css" type="text/css"/>
    <link rel="stylesheet" href="/css/bootstrap-select.css" type="text/css"/>
    <link rel="stylesheet" href="/css/finance/payment-record.css">
    <link rel="stylesheet" href="/css/orderManage/backmoney.css">
    <script th:inline="javascript">
        var accountType = [[${dept}]];
        console.log(accountType);
    </script>
</head>
<body>
<!--财务端  退款记录-->
<div class="container-fluid">
    <div class="card m-0">
        <div class="card-header">
            <h1>退款记录</h1>
        </div>
        <div class="card-body">
            <div class="row content-action">
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <!-- 全部 本周 本月 本年 -->
                    <div class="time-search pull-left">
                        <input type="hidden" id="dateType" name="dateType"/>
                        <div class="all active-second" onclick="selectTime('all')">全部</div>
                        <div class="week"  onclick="selectTime('week')">本周</div>
                        <div class="month" onclick="selectTime('month')">本月</div>
                        <div class="day" onclick="selectTime('day')">今天</div>
                        <div class="customize" onclick="selectTime('customize')">自定义</div>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 custom-input pull-left" id="customInput">
                        <div class="input-group">
                            <input type="text" class="form-control datepicker" placeholder="开始时间" id="startTm">
                            <span class="input-group-addon">至</span>
                            <input type="text" class="form-control datepicker" placeholder="结束时间" id="endTm">
                            <div class="input-group-btn">
                                <button type="button" class="btn btn-default" id="customDateBtn" onclick="searchReturnMoneyList(1)">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 pull-right">
                    <div class="pull-right">
                        <button class="btn btn-default btn-senior pull-right" data-toggle="collapse"
                                data-target="#filterContentNew" aria-expanded="false"
                                aria-controls="filterContentNew" >
                            <i class="mdi mdi-sort-variant"></i>高级筛选
                        </button>
                        <div class="min-search pull-right" style="margin-left: 15px">
                            <input class="form-control" type="text" placeholder="订单号"
                                   id="orderNumberSearch" name="orderNumberSearch">
                            <button class="btn btn-primary" type="button" onclick="searchReturnMoneyList(1)">
                                <i class="mdi mdi-magnify"></i><span>搜索</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="collapse filter-content" id="filterContentNew" style="">
                <div class="row">
                    <div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label for="backStatus">回款状态</label>
                        <div>
                            <select id="backStatus" name="backStatus" class="form-control" type="text">
                                <option selected value="">全部</option>
                                <option value="0">审核中</option>
                                <option value="1">未通过</option>
                                <option value="2">已退款</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label for="branch_office">分公司</label>
                        <div>
                            <input class="form-control" type="text" placeholder="请输入分公司" id="branch_office" name="branch_office" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label for="all">所有人</label>
                        <div>
                            <input class="form-control" type="text" placeholder="请输入所有人" id="all" name="all" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label" for="createTm">申请时间</label>
                        <div>
                            <input type="text" id="createTm" class="form-control search-time date-input"
                                   placeholder="请输入申请时间">
                        </div>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label for="reviewer">审核人</label>
                        <div>
                            <input class="form-control" type="text" placeholder="请输入审核人" id="reviewer" name="reviewer" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12 btn-box" style="margin-top: 20px;">
                        <label class="control-label">&nbsp;</label>
                        <div class="text-right">
                            <button class="btn btn-link" onclick="clearAllData()">重置</button>
                            <button class="btn btn-primary" type="button" onclick="searchReturnMoneyList(2)">
                                <i class="mdi mdi-magnify"></i><span>搜索</span></button>
                        </div>
                    </div>
                </div>
            </div>
            <table id="refundTable"></table>
        </div>
    </div>
</div>
<!--退款详情-->
<div class="modal fade" id="refundModal" tabindex="-1" role="dialog" aria-labelledby="refundModal" >
    <div class="modal-dialog" role="document" style="width: 70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" onclick="cancel()" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h5 class="modal-title" id="refundLable">退款明细表</h5>
            </div>
            <div class="modal-body">
                <div class="step-group">
                    <input type="text" id="adoptSituation" hidden>
                    <ul class="nav-step step-anchor m-b-0">
                        <li class="nav-step-item">
                            <a href="#step-1" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="step-1" class="collapsed">
                                <h6>分总</h6>
                                <p class="m-0" id="fzStatus">-</p>
                            </a>
                        </li>
                        <li class="nav-step-item">
                            <a href="#step-2" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="step-2" class="collapsed">
                                <h6>客服</h6>
                                <p class="m-0" id="kfStatus">-</p>
                            </a>
                        </li>
                        <li class="nav-step-item">
                            <a href="#step-3" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="step-3" class="collapsed">
                                <h6>销总</h6>
                                <p class="m-0" id="xzStatus">-</p>
                            </a>
                        </li>
                        <li class="nav-step-item">
                            <a href="#step-4" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="step-4" class="collapsed">
                                <h6>网络部</h6>
                                <p class="m-0" id="wlbStatus">-</p>
                            </a>
                        </li>
                        <li class="nav-step-item">
                            <a href="#step-5" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="step-5" class="collapsed">
                                <h6>财务</h6>
                                <p class="m-0" id="cwStatus">-</p>
                            </a>
                        </li>
                    </ul>
                    <div class="collapse-content">
                        <div class="panel-collapse collapse" id="step-1" role="tabpanel">
                            <div class="step-info">
                                <h5>分总审核记录：</h5>
                                <p><em>操作人：</em><span id="fzName">-</span></p>
                                <p><em>操作时间：</em><span id="fzTime">-</span></p>
                                <p><em>操作备注：</em><span id="fzRemarks">-</span></p>
                            </div>
                        </div>
                        <div class="panel-collapse collapse" id="step-2" role="tabpanel">
                            <div class="step-info">
                                <h5>客服审核记录：</h5>
                                <p><em>操作人：</em><span id="kfName">-</span></p>
                                <p><em>操作时间：</em><span id="kfTime">-</span></p>
                                <p><em>操作备注：</em><span id="kfRemarks">-</span></p>
                            </div></div>
                        <div class="panel-collapse collapse" id="step-3" role="tabpanel">
                            <div class="step-info">
                                <h5>销总审核记录：</h5>
                                <p><em>操作人：</em><span id="xzName">-</span></p>
                                <p><em>操作时间：</em><span id="xzTime">-</span></p>
                                <p><em>操作备注：</em><span id="xzRemarks">-</span></p>
                            </div></div>
                        <div class="panel-collapse collapse" id="step-4" role="tabpanel">
                            <div class="step-info">
                                <h5>网络部审核记录：</h5>
                                <p><em>操作人：</em><span id="wlbName">-</span></p>
                                <p><em>操作时间：</em><span id="wlbTime">-</span></p>
                                <p  id="wlbActionBox"><em>产品明细：</em><span id="wlbAction">-</span></p>
                                <p><em>操作备注：</em><span id="wlbRemarks">-</span></p>
                            </div></div>
                        <div class="panel-collapse collapse" id="step-5" role="tabpanel">
                            <div class="step-info">
                                <h5>财务审核记录：</h5>
                                <p><em>操作人：</em><span id="cwName">-</span></p>
                                <p><em>操作时间：</em><span id="cwTime">-</span></p>
                                <p><em>操作备注：</em><span id="cwRemarks">-</span></p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12" id="orderProductDetails">
<!--                        <textarea class="form-control" style="height: 150px" id="refundDetail">1111</textarea>-->
                        <div class="titContant">
                            <table>
                                <tr>
                                    <td>订单编号：<span class="text" id="serialNumber">-</span></td>
                                    <td>合同编号： <span class="text" id="contractNumber">-</span></td>
                                    <td>订单状态：
                                        <span class="text">
                                            <span id="orderState">-</span>
<!--                                            <span>已完成</span>-->
<!--                                            <span>作废</span>-->
<!--                                            <span>部分回款</span>-->
                                        </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td>客户名称：<span class="text" id="customerName">-</span></td>
                                    <td>客户编号：<span class="text" id="customerNumber">-</span></td>
                                    <td>订单所有人：<span class="text" id="oderUser">-</span></td>
                                </tr>
                                <tr>
                                    <td>所属分公司：<span class="text" id="branchOffice">-</span></td>
                                    <td>退款类型：<span class="text" id="refundType">-</span></td>
                                    <td>创建日期：<span class="text" id="createTime">-</span></td>
                                </tr>
                                <tr>
                                    <td>发放状态：<span class="text" id="royaltyStatus">-</span></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12" id="balanceRefundDetails" style="display: none">
                        <!--                        <textarea class="form-control" style="height: 150px" id="refundDetail">1111</textarea>-->
                        <input type="hidden" id="customerId">
                        <div class="titContant">
                            <table>
                                <tr>
                                    <td>客户名称：<span class="text" id="refundCustomerName">-</span></td>
                                    <td>客户编号：<span class="text" id="refundCustomerNumber">-</span></td>
                                    <td>退款类型：<span class="text" id="balanceRefundType">-</span></td>
                                </tr>
                                <tr>
                                    <td>退款金额：<span class="text" id="refundMoney">-</span></td>
                                    <td>退款备注：<span class="text" id="refundMask">-</span></td>
                                    <td>申请时间：<span class="text" id="refundCreate">-</span></td>
                                </tr>
                                <tr>
                                    <td>所属分公司：<span class="text" id="refundBranchOffice">-</span></td>
                                    <td>申请人：<span class="text" id="refundPeople">-</span></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12"  id="refundMessTableModal">
                        <table id="refundMessTable"></table>
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <p>申请退款金额：<span id="applyBackMoney">-</span></p>
                        <p>申请退款备注：<span id="refundRemark">-</span></p>
                    </div>
                    <div class="isShow_Audit">
                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="form-group col-lg-2 col-md-2 col-sm-2 col-xs-2">
                                <p style="font-size: 18px;font-weight: 600">退款审核</p>
                            </div>
                            <div class="form-group col-lg-8 col-md-8 col-sm-8 col-xs-8">
                                <div class="form-content">
                                    <label class="lyear-radio radio-inline radio-primary">
                                        <input type="radio" value="2" id="audit" name="whetherIncludedAchievement" onclick="auditState()"><span>通过审核</span>
                                    </label>
                                    <label class="lyear-radio radio-inline radio-primary">
                                        <input type="radio" value="1" id="not_audit" name="whetherIncludedAchievement" checked onclick="auditState()"><span>未通过审核</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-4 success-label cost-label">
                            <label class="control-label ">服务费</label>
                            <div class="form-content">
                                <input type="text" class="form-control amount" id="serviceCharge" placeholder="请输入申请退款金额"  disabled/>
                            </div>
                        </div>
                        <div class="col-sm-4 success-label cost-label" id="costLabel">
                            <label class="control-label ">实际退款金额</label>
                            <div class="form-content">
                                <input type="hidden" id="actualRefundAmountVal">
                                <input type="text" class="form-control amount"  id="actualRefundAmount" placeholder="请输入实际退款金额" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,4})?).*$/g, '$1')" disabled/>
                            </div>
                        </div>
                        <div class="col-sm-4 success-label">
                            <label class="control-label label-required">审批备注</label>
                            <div class="form-content">
                                <textarea type="text" class="form-control"  id="actualRefundRemark" placeholder="请输入审批备注" maxlength="100"></textarea>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="isSubmit" onclick="submitRefund()">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="cancel()">取消</button>
            </div>
        </div>
    </div>
</div>
<!--未通过审核-->
<div class="modal fade" id="promptFailure" tabindex="-1" role="dialog" aria-labelledby="promptFailure" >
    <div class="modal-dialog" role="document" style="width: 50%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="cancel()"><span aria-hidden="true">×</span></button>
                <h5 class="modal-title">提示</h5>
            </div>
            <div class="modal-body" style="height: 200px;display: flex;justify-content: center;align-items: center">
                <div>当前状态为 <span style="font-size: 18px;font-weight: 800;margin:0 20px 0 20px">未通过审核</span> 如无错误，请点击确认，完成审核</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="sureBtn(1)">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="cancel()">取消</button>
            </div>
        </div>
    </div>
</div>
<!--通过审核-->
<div class="modal fade" id="promptSuccess" tabindex="-1" role="dialog" aria-labelledby="promptSuccess" >
    <div class="modal-dialog" role="document" style="width: 50%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="cancel()"><span aria-hidden="true">×</span></button>
                <h5 class="modal-title">提示</h5>
            </div>
            <div class="modal-body" style="height: 200px;display: flex;justify-content: center;align-items: center">
                <div>当前状态为
                    <span style="font-size: 18px;font-weight: 800;margin:0 20px 0 20px">通过审核</span>
                    退款金额为
                    <span style="font-size: 18px;font-weight: 800;margin:0 20px 0 20px" id="refundNumber">111111￥</span>
                    如无错误，请点击确认，完成审核
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary"  onclick="sureBtn(2)">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="cancel()">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table.min-1.18.3.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/js/crm/common/common.js"></script>
<!--table固定列-->
<script type="text/javascript" src="/js/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns-1.18.3.js"></script>
<!--时间选择插件-->
<script src="/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="/js/jquery-confirm/jquery-confirm.min.js"></script>
<script src="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<!--日期选择插件-->
<script src="/js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<!-- 拖动 -->
<script src="/js/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js"></script>
<script src="/js/crm/common/colResizable-1.6.min.js"></script>
<!-- 多选框下拉 -->
<script type="text/javascript" src="/js/bootstrap-multiselect.js"></script>
<script type="text/javascript" src="/js/bootstrap-select.js"></script>
<script type="text/javascript" src="/js/bootstrap.lyear.dropdowntree.min.js"></script>
<!-- 子页面公用js -->
<script src="/js/crm/common/pageCommon.js"></script>
<script src="/js/crm/finance/backMoney.js"></script>
</html>